package cn.damai.backstage.controller;

import cn.damai.backstage.model.User;
import cn.damai.backstage.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping
public class LoginController {

    @Autowired
    private UserService userService;


    @RequestMapping("login")
    public String login(User user){
        User u = userService.queryByUser(user);
        if(u != null){
            return "index";
        }else {
            return "login";
        }

    }


}
